<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #app{
            width: 500px;
            margin: 100px auto;
        }
        input{
            width: 300px;
        }
        span{
            background-color: aqua;
            margin-left: 10px;
        }
    </style>
</head>
<body>
    <div id="app">
        <div class="top">
            <input type="text" v-model="from.text">
            <button @click="add">搜索</button>
        </div>
        <div class="bottom">
            <h1>历史记录</h1>
            <span v-for="(item) in list"> {{item}} </span>
        </div>
    </div>
</body>
</html>
<script src="./vue-2.5.21.js"></script>
<script>
    var v = new Vue({
        el:'#app',
        data:{
            from:{text:''},
            list:[]
        },
        methods:{
            add(){
                this.list.push(this.from.text)
                this.from.text = ''
            }
        }
    })
</script>